package train48days;
import java.util.*;
public class 五子棋 {
        public static int[][] direc = {{0,1},{0,-1},{-1,0},{1,0},{-1,-1},{-1,1},{1,1},{1,-1}};
        public static boolean solve(char[][] map){
            for(int i = 0;i < 20;i++){
                for(int j = 0;j < 20;j++){
                    if(map[i][j] == '*' || map[i][j] == '+'){
                        for(int k = 0;k < 8;k++){
                            int count = 1;
                            int x = i + direc[k][0];
                            int y = j + direc[k][1];
                            while(x >= 0 && x < 20 && y >= 0 && y <20 && map[i][j] == map[x][y]){
                                count++;
                                x = x + direc[k][0];
                                y = y + direc[k][1];
                            }
                            if(count == 5){
                                return true;
                            }
                        }

                    }
                }
            }
            return false;
        }
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            while(sc.hasNext()){
                char[][] map = new char[20][20];
                for(int i = 0;i < 20;i++){
                    String s = sc.next();
                    for(int j = 0;j < 20;j++){
                        map[i][j] = s.charAt(j);
                    }
                }
                if(solve(map)){
                    System.out.println("Yes");
                }else{
                    System.out.println("No");
                }
            }
        }
    }
